<%@ page language="java" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>使用ajax进行传值</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
         function  t() {
             $.ajax({
                 url:'/json',
                 type:'get',
                 cache:false,
                 dataType:'json',
                 success:function (d) {
                     $('#ttt').html(d);
                 }
             })
         }



        $(function () {
            t();
            setInterval(t,1000);
        })


    </script>

</head>
<body>
<h3 id="ttt"></h3>
</body>
</html>